.class public Lcom/netease/newsreader/view/MyPopupWindow;
.super Landroid/widget/PopupWindow;
.source "MyPopupWindow.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/netease/newsreader/view/MyPopupWindow$ContentFrame;
    }
.end annotation


# instance fields
.field private mContent:Lcom/netease/newsreader/view/MyPopupWindow$ContentFrame;

.field private mContext:Landroid/content/Context;

.field private mTouchInterceptor:Landroid/view/View$OnTouchListener;


# direct methods
.method public constructor <init>(Landroid/content/Context;II)V
    .locals 1
    .parameter "context"
    .parameter "width"
    .parameter "height"

    .prologue
    .line 28
    invoke-direct {p0, p1}, Landroid/widget/PopupWindow;-><init>(Landroid/content/Context;)V

    .line 29
    iput-object p1, p0, Lcom/netease/newsreader/view/MyPopupWindow;->mContext:Landroid/content/Context;

    .line 30
    new-instance v0, Lcom/netease/newsreader/view/MyPopupWindow$ContentFrame;

    invoke-direct {v0, p0, p1}, Lcom/netease/newsreader/view/MyPopupWindow$ContentFrame;-><init>(Lcom/netease/newsreader/view/MyPopupWindow;Landroid/content/Context;)V

    iput-object v0, p0, Lcom/netease/newsreader/view/MyPopupWindow;->mContent:Lcom/netease/newsreader/view/MyPopupWindow$ContentFrame;

    .line 31
    iget-object v0, p0, Lcom/netease/newsreader/view/MyPopupWindow;->mContent:Lcom/netease/newsreader/view/MyPopupWindow$ContentFrame;

    invoke-virtual {p0, v0}, Lcom/netease/newsreader/view/MyPopupWindow;->setContentView(Landroid/view/View;)V

    .line 33
    invoke-virtual {p0, p2}, Lcom/netease/newsreader/view/MyPopupWindow;->setWidth(I)V

    .line 34
    invoke-virtual {p0, p3}, Lcom/netease/newsreader/view/MyPopupWindow;->setHeight(I)V

    .line 35
    const/4 v0, 0x1

    invoke-virtual {p0, v0}, Lcom/netease/newsreader/view/MyPopupWindow;->setFocusable(Z)V

    .line 36
    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lcom/netease/newsreader/view/MyPopupWindow;->setBackgroundDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 37
    invoke-virtual {p0}, Lcom/netease/newsreader/view/MyPopupWindow;->update()V

    .line 38
    return-void
.end method

.method static synthetic access$0(Lcom/netease/newsreader/view/MyPopupWindow;)Landroid/view/View$OnTouchListener;
    .locals 1
    .parameter

    .prologue
    .line 25
    iget-object v0, p0, Lcom/netease/newsreader/view/MyPopupWindow;->mTouchInterceptor:Landroid/view/View$OnTouchListener;

    return-object v0
.end method

.method private setContentViewInternal(Landroid/view/View;)V
    .locals 1
    .parameter "contentView"

    .prologue
    .line 82
    iget-object v0, p0, Lcom/netease/newsreader/view/MyPopupWindow;->mContent:Lcom/netease/newsreader/view/MyPopupWindow$ContentFrame;

    if-ne v0, p1, :cond_0

    .line 83
    invoke-super {p0, p1}, Landroid/widget/PopupWindow;->setContentView(Landroid/view/View;)V

    .line 91
    :goto_0
    return-void

    .line 85
    :cond_0
    iget-object v0, p0, Lcom/netease/newsreader/view/MyPopupWindow;->mContent:Lcom/netease/newsreader/view/MyPopupWindow$ContentFrame;

    invoke-virtual {v0}, Lcom/netease/newsreader/view/MyPopupWindow$ContentFrame;->removeAllViews()V

    .line 86
    if-eqz p1, :cond_1

    .line 87
    iget-object v0, p0, Lcom/netease/newsreader/view/MyPopupWindow;->mContent:Lcom/netease/newsreader/view/MyPopupWindow$ContentFrame;

    invoke-virtual {v0, p1}, Lcom/netease/newsreader/view/MyPopupWindow$ContentFrame;->addView(Landroid/view/View;)V

    .line 89
    :cond_1
    invoke-virtual {p0}, Lcom/netease/newsreader/view/MyPopupWindow;->update()V

    goto :goto_0
.end method


# virtual methods
.method protected checkDismissKey(I)Z
    .locals 1
    .parameter "keyCode"

    .prologue
    .line 54
    const/4 v0, 0x4

    if-ne p1, v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public dispatchKeyEvent(Landroid/view/KeyEvent;)Z
    .locals 4
    .parameter "event"

    .prologue
    const/4 v2, 0x1

    .line 41
    invoke-virtual {p1}, Landroid/view/KeyEvent;->getKeyCode()I

    move-result v1

    .line 42
    .local v1, keyCode:I
    invoke-virtual {p1}, Landroid/view/KeyEvent;->getAction()I

    move-result v0

    .line 44
    .local v0, action:I
    invoke-virtual {p0}, Lcom/netease/newsreader/view/MyPopupWindow;->isShowing()Z

    move-result v3

    if-eqz v3, :cond_1

    invoke-virtual {p0, v1}, Lcom/netease/newsreader/view/MyPopupWindow;->checkDismissKey(I)Z

    move-result v3

    if-eqz v3, :cond_1

    .line 45
    if-ne v0, v2, :cond_0

    .line 46
    invoke-virtual {p0}, Lcom/netease/newsreader/view/MyPopupWindow;->dismiss()V

    .line 50
    :cond_0
    :goto_0
    return v2

    :cond_1
    const/4 v2, 0x0

    goto :goto_0
.end method

.method public getContentView()Landroid/view/View;
    .locals 2

    .prologue
    .line 64
    iget-object v0, p0, Lcom/netease/newsreader/view/MyPopupWindow;->mContent:Lcom/netease/newsreader/view/MyPopupWindow$ContentFrame;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lcom/netease/newsreader/view/MyPopupWindow$ContentFrame;->getChildAt(I)Landroid/view/View;

    move-result-object v0

    return-object v0
.end method

.method public setContentView(I)V
    .locals 3
    .parameter "layout"

    .prologue
    .line 68
    const/4 v0, 0x0

    .line 69
    .local v0, contentView:Landroid/view/View;
    if-eqz p1, :cond_0

    .line 70
    iget-object v2, p0, Lcom/netease/newsreader/view/MyPopupWindow;->mContext:Landroid/content/Context;

    invoke-static {v2}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v1

    .line 71
    .local v1, inflater:Landroid/view/LayoutInflater;
    const/4 v2, 0x0

    invoke-virtual {v1, p1, v2}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v0

    .line 73
    .end local v1           #inflater:Landroid/view/LayoutInflater;
    :cond_0
    invoke-direct {p0, v0}, Lcom/netease/newsreader/view/MyPopupWindow;->setContentViewInternal(Landroid/view/View;)V

    .line 74
    return-void
.end method

.method public setContentView(Landroid/view/View;)V
    .locals 0
    .parameter "contentView"

    .prologue
    .line 78
    invoke-direct {p0, p1}, Lcom/netease/newsreader/view/MyPopupWindow;->setContentViewInternal(Landroid/view/View;)V

    .line 79
    return-void
.end method

.method public setTouchInterceptor(Landroid/view/View$OnTouchListener;)V
    .locals 0
    .parameter "l"

    .prologue
    .line 59
    iput-object p1, p0, Lcom/netease/newsreader/view/MyPopupWindow;->mTouchInterceptor:Landroid/view/View$OnTouchListener;

    .line 60
    return-void
.end method
